#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
//int main()
//{
// printf("pid: %d\n", getpid());
// printf("ppid: %d\n", getppid());
// return 0;
//}
#include<stdlib.h>
int main()
{
   pid_t id = fork();
   if(id < 0){
   perror("fork");
   return 1; }
   else if(id > 0){ //parent
     printf("parent[%d] is sleeping...\n", getpid());
     sleep(30);
    }
   else{
     printf("child[%d] is begin Z...\n", getpid());
     sleep(5);
     exit(EXIT_SUCCESS); 
   }
 return 0;
}
